// ml:run = $bin < input
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>

using ll = long long;
ll const mo = 100000007ll;
ll const b = 17;
int const maxn = 5007;
std::string s;
ll pow[maxn];
ll inv_pow[maxn];
ll hsum[maxn];
ll rhsum[maxn];
int pat[maxn][maxn];
int ans[30];
int len;

using v_type = ll;

void extended_gcd(v_type a, v_type b, v_type & d, v_type & x, v_type & y)
{
    if (!b) { d = a; x = 1; y = 0; }
    else {
        extended_gcd(b, a % b, d, y, x);
        y -= x * (a/b);
    }
}

v_type inverse(v_type t, v_type p)
{
    v_type x, y, d;
    extended_gcd(t, p, d, x, y);
    return (x % p + p) % p;
}

ll rcalc(int l, int r)
{
    auto sum = rhsum[l];
    sum -= rhsum[r + 1];
    sum %= mo;
    sum = (sum + mo) % mo;
    return (sum * inv_pow[len - r - 1]) % mo;
}

ll calc(int l, int r)
{
    auto sum = hsum[r];
    if (l) sum -= hsum[l - 1];
    sum %= mo;
    sum = (sum + mo) % mo;
    return (sum * inv_pow[l]) % mo;
}

void init()
{
    pow[0] = 1;
    hsum[0] = s[0];
    inv_pow[0] = inverse(1, mo);
    for (int i = 1; i < len; i++) {
        pow[i] = (pow[i - 1] * b) % mo;
        inv_pow[i] = inverse(pow[i], mo);
        hsum[i] = (hsum[i - 1] +  s[i] * pow[i]) % mo;
    }
    for (int i = len - 1; i >= 0; i--) {
        rhsum[i] = (rhsum[i + 1] + s[i] * pow[len - 1 - i]) % mo;
    }
}

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin >> s;
    len = s.size();
    init();

    for (int l = 1; l <= len; l++)
        for (int i = 0; i + l - 1 < len; i++) {
            auto j = i + l - 1;
            auto tl = j - i + 1;
            auto const& p1 = pat[i][i + tl/2 - 1];
            auto const& p2 = pat[j - tl/2 + 1][j];
            if (calc(i, j) == rcalc(i, j)) {
                pat[i][j] = 1;
            }
            auto h1 = calc(i, i + tl/2 - 1);
            auto h2 = rcalc(j - tl/2 + 1, j);
            if (h1 != h2) continue;
            if (p1 == p2) pat[i][j] = p1 + 1;
        }
    for (int i = 0; i < len; i++) {
        for (int j = i; j < len; j++) {
            ans[pat[i][j]]++;
        }
    }
    for (int i = 27; i >= 0; i--)
        ans[i] += ans[i + 1];
    for (int i = 1; i <= len; i++) {
        if (i > 1) std::cout << " ";
        if (i >= 30) std::cout << "0";
        else std::cout << ans[i] ;
    }
    std::cout << "\n";
    // std::cout <<              " ===========================\n";
    // std::cout << pat[0][6] << " \n";
    // auto i = 1, j = 2, tl = j - i + 1;
    // auto p1 = pat[i][i + tl/2 - 1];
    // auto p2 = pat[j - tl/2 + 1][j];
    // auto h1 = calc(i, i + tl/2 - 1);
    // auto h2 = rcalc(j - tl/2 + 1, j);
    // std::cout << p1 <<        " " << p2 << "\n";
    // std::cout << h1 <<        " " << h2 << "\n";
}

